package com.xxgc.vfc.api.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @Author: SJY
 * @Date: 2023/11/13 09:22:24
 */
@Data
@ApiModel(value = "用户手机号密码注册", description = "手机号密码注册")
public class UserRegisterByPhoneVO implements Serializable {
    @NotNull(message = "用户名不能为空")
    @Size(min = 2,max = 6,message = "用户名长度在2-6位")
    @Pattern(regexp="^[\\u4e00-\\u9fa5a-zA-Z0-9]+$",message = "用户名不能用特殊字符，只能中文、字母、或数字")
    @ApiModelProperty("用户名")
    private String nickName;

    @NotNull(message = "密码不能为空")
    @Size(min = 8,max = 20,message = "密码长度在8-20位")
    @Pattern(regexp="^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).+$",message = "密码必须包含大小写字母和数字")
    @ApiModelProperty("密码")
    private String passWord;

    @NotNull(message = "电话号不能为空")
    @Pattern(regexp="^1[3-9]\\d{9}$",message = "请输入11位中国电话号码")
    @ApiModelProperty("电话号码")
    private String phone;
}
